{include(header)}
<div class="pMenu" id="id_pMenu">
	<li class="sel">管理</li>
	<li onclick="master_open({id:'add_config',title:'添加站点',url:'{fun_get::url(array('app_act'=>'edit','id'=>0))}',w:1000});" class="x_btn">添加</li>
	<li onclick="admin.menu_display(0);" class = "x_btn">查找</li>
	<li class = "x_btn"><a href="javascript:parent.thisjs.klkkdj_open('微信站点-帮助','app=service&app_act=help&key=help.weixin.redpack');" title="帮助"><img src="images/faq.gif"></a></li>
	<li class="fdpic" onclick="master_open({url:'common.php?app=config&app_module=user&dir={$app_dir}&filename=weixin&key=weixin.redpack',title:'设置字段',w:400});">&nbsp;</li>
</div>
<div class="btnMenuDiv" id="id_btnMenuDiv"{if($arr_list['issearch']==0)} style="display:none"{/if}>
<li>分类：
<select name="s_shop_type">
<option value="">全部</option>
{foreach($arr_type as $item)}
	<option value="{$item}"{if($item==fun_get::get('s_shop_type'))} selected{/if}>{$item}</option>
{/foreach}
</select>
</li>
<li>状态：<select name="s_state">
		<option value="-999"></option>
		{foreach($arr_state as $item=>$key)}
			<option value="{$key}"{if($key==fun_get::get("s_state"))} selected{/if}>{$item}</option>
		{/foreach}
		</select></li>
<li>添加时间：<input type="text" id="s_addtime1" name="s_addtime1" value="{fun_get::get('s_addtime1')}" class='pTxtDate' onfocus="new Calendar().show(this);"> 到 <input type="text" name="s_addtime2" id="s_addtime2" value="{fun_get::get('s_addtime2')}" class='pTxtDate' onfocus="new Calendar().show(this);"></li>
<li>关 键 字：<input type="text" id="s_key" name="s_key" value="{fun_get::get('s_key')}">　<input type="button" name="btn_s_ok" value="查找" class="pBtn" onclick="admin.search();"> 　<input type="button" name="btn_s_clear" value="清空" class="pBtn" onclick="admin.clear_search();"></li>
</table>
</div>
<div class="pMain" id="id_main">
<div class="pTableBox" id="id_table_box">
	<div class='pTableTit' id="id_table_title">
		<li><span class="x_tit" style="width:25px">&nbsp;</span></li>
		{foreach($arr_list["tabtit"] as $item)}
			<li><span class="x_tit"{if($item["w"]>0)} style="width:{$item["w"]}px"{/if} onclick="admin.table.list1.sort('{$item['key']}')">{$item["name"]}
			{if(isset($arr_list['sort'][$item['key']]))}<img src="images/sort_{$arr_list['sort'][$item['key']]}.png">{/if}</span><span class="x_split"></span></li>
		{/if}
		<li><span class="x_tit" style="cursor:none;width:100px">操作</span></li>
	</div>
	<div class="pTableList" id="id_table_list">
		<div class='pTable' id="id_table">
			{foreach($arr_list['list'] as $item)}
			<div class='pTabRow'>
				<li><input type='checkbox' name='selid[]' value="{$item['redpack_id']}"></li>
				{foreach($arr_list["tabtd"] as $field)}
					<li>{if(empty($item[$field]))}&nbsp;{else}{$item[$field]}{/if}</li>
				{/foreach}
				<li>
				{if($this_limit->chk_act("edit"))}
				<input type="button" name="btnedit" value="编辑" onclick="master_open({id:{$item['redpack_id']},title:'编辑',w:1000});" class="pBtn">
				{/if}
				{if($this_limit->chk_act("del"))}<input type="button" name="btnedit" value="删除" onclick="admin.ajax_delete({$item['redpack_id']});" class="pBtn2">{/if}
				</li>
			</div>
			{/foreach}
		</div>
	</div>
</div>
</div>
<div class="pPage" id="id_pPage">
{$arr_list['pagebtns']}
</div>
<div class="pFootAct" id="id_pFootAct">
<li>
<label><input type='checkbox' name='selall' value='1'>全选</label>　
<select name="selact" onchange="thisjs.act(this.value);">
	<option value="">--操作--</option>
		{if($this_limit->chk_act("delete"))}<option value="delete">删除</option>{/if}
	</select>
	&nbsp;<input type="button" name="btnExe" value="执行" onclick="admin.selact();" class="pBtn">
</li>
</div>
<script src="admin.table.js"></script>
<script>
//初始化表格控件
kj.onload(function(){
	admin.table.list1.init('#id_table_title' , '#id_table');

});
//自动保存
admin.table.list1.save_resize = function() {
	var lng_w = (kj.w(this.field));
	kj.ajax.get("common.php?app=config&app_module=user&dir={$app_dir}&app_act=save_resize&filename=weixin&key=weixin.redpack&index=" + this.fieldsindex + "&w=" + lng_w , function(data){
		//alert(data);
	});
}
admin.table.list1.sort = function(key) {
	if(key=='user_name') return;
	kj.ajax.get("common.php?app=config&app_module=user&dir={$app_dir}&app_act=sort&key=weixin.redpack&filename=weixin&sortby=" + key , function(data){
			var obj_data=kj.json(data);
			if(!obj_data.isnull) {
				admin.refresh();
			}
	});
}
//当前页面js对象
var thisjs = new function() {
}
</script>
{include(footer)}